/**
 *@描述: 私有路由，需要登录
 *@date:2022/3/29
 *@author:heli
 */
import React from 'react';
import {RouteObjectRule, MetaRule} from "../../react-router-dom6-guard";

interface MetaRuleDefine extends MetaRule {
    auth?: true
}

interface RouterRule extends RouteObjectRule {
    meta: MetaRuleDefine
}

const PrivateRouters: RouterRule[] = [
    {
        path: 'home',
        page: () => import("../../pages/Home/home"),
        meta: {
            auth: true
        },
        children: [
            {
                index: true, //设置默认
                path: '*',
                meta: {
                    title: '个人主页',
                },
                page: () => import('../../pages/Home/index/index')
            },
            {
                path: 'organization',
                meta: {
                    title: '组织机构管理',
                },
                page: () => import('../../pages/Home/organization/index')
            },
        ],
    },
];
export default PrivateRouters;
